<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ taglib uri="/WEB-INF/myfaces_sandbox.tld"   prefix="s" %>

<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Cliente Dettaglio"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>     
    <script language="javascript" src="./script/popup_full_center.js"></script>    
    <script language="javascript" src="./script/ripristinoSessione.js"></script>    
    <h:form binding="#{dettaglioClienteFed.form}">          
        <t:saveState value="#{beanClienteFed}"/>
        <t:saveState value="#{beanCliente}"/>
        <br/>

        <table class="dettaglio">
            <tbody>                      

            <div class="storico">
                <strong>CLIENTE: <h:outputText  value=" #{beanCliente.ragioneSociale}"/></strong>        
            </div>

            <tr>        
                <td class="etichettaDettaglio"><strong><t:outputLabel for="data" value="Data"/></strong></td>
                <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputCalendar id="data" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" styleClass="campoTesto" required="true" value="#{beanClienteFed.data}">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <h:message style="color: red" for="data" showDetail="true" showSummary="false" />
                </td>
            </tr> 

            <tr>        
                <td class="etichettaDettaglio"><strong><t:outputLabel for="tipoOperazione" value="Tipo Operazione"/></strong></td>
                <td>
                    <t:selectOneMenu id="um" value="#{beanClienteFed.tipoOperazione}" >
                        <f:selectItem itemValue="A" itemLabel="Accredito"/>
                        <f:selectItem itemValue="P" itemLabel="Premio"/>
                        <f:selectItem itemValue="J" itemLabel="Punti Jolly"/>
                        <f:selectItem itemValue="R" itemLabel="Da altra scheda"/>
                        <f:selectItem itemValue="Z" itemLabel="Azzeramento"/>                        
                    </t:selectOneMenu> 
                </td>
            </tr> 

            <tr>
                <td class="etichettaDettaglio"><strong><t:outputLabel for="punti" value="Punti"/></strong></td>
                <td><t:inputText id="punti" value="#{beanClienteFed.punti}" size="10" maxlength="7" styleClass="dettaglio_InputText" style="text-align: right"  required="true" >
                        <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.0" />
                    </t:inputText>
                    <br/><h:message style="color: red" for="punti" showDetail="true" showSummary="false" /></td>

            </tr>

            <tr>
                <td class="etichettaDettaglio"><strong><t:outputLabel for="note" value="Note"/></strong></td>
                <td colspan="5"><t:inputTextarea id="note" value="#{beanClienteFed.note}" rows="3" cols="100" required="false" styleClass="dettaglio_InputText"/></td>
            </tr>

        </table>


        <br/>
        <t:inputHidden value="#{beanClienteFed.id}"/>
        <table bgcolor="#FFFFFF" width="750px">
            <tr>     
                <td>
                    <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                        <t:graphicImage url="/image/go-home.png" border="0"/>
                    </h:commandLink>              
                </td>   
                <td>
                    <h:commandLink action="#{dettaglioClienteFed.primo}"  rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/primo.png" border="0" title="Vai al primo elemento"/>
                        <f:param name="bean" value="beanClienteFed"/>                        
                        <f:param name="id" value="#{beanClienteFed.id}"/>                 
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteFed.precedente}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/indietro.png" border="0" title="Indietro"/>
                        <f:param name="bean" value="beanClienteFed"/>                        
                        <f:param name="id" value="#{beanClienteFed.id}"/>     
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteFed.successivo}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/avanti.png" border="0" title="Avanti"/>
                        <f:param name="bean" value="beanClienteFed"/>                        
                        <f:param name="id" value="#{beanClienteFed.id}"/>      
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteFed.ultimo}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/ultimo.png" border="0" title="Vai all'ultimo elemento"/>
                        <f:param name="bean" value="beanClienteFed"/>                        
                        <f:param name="id" value="#{beanClienteFed.id}"/>         
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink  title="LISTA" id="lista" action="#{dettaglioClienteFed.lista}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/lista.png" border="0" title="Carica lista" style="width:32px; height:32px"/>
                        <f:param name="bean" value="ClienteFed" />
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink  title="Torna Master" id="tornaMaster" action="#{dettaglioClienteFed.tornaMaster}" immediate="true">
                        <t:graphicImage url="image/undo.png" border="0" title="Torna Master"/>
                        <f:param name="beanPadre" value="beanCliente" />
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmDelete(this);" title="cancella" action="#{dettaglioClienteFed.cancella}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/stop.png" border="0" title="Cancella"/>
                        <f:param name="bean" value="beanClienteFed" />
                        <f:param name="idPadre" value="#{beanCliente.id}"/>                                  
                    </h:commandLink>                
                </td>
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmUpdate(this);" title="modifica" action="#{dettaglioClienteFed.modifica}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/salva.png" border="0" title="Salva modifiche"/>
                        <f:param name="bean" value="beanClienteFed" />
                        <f:param name="idPadre" value="#{beanCliente.id}"/>                                  
                    </h:commandLink>                
                </td>
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmSave(this);" title="salva inserimento" action="#{dettaglioClienteFed.inserisci}" rendered="#{beanClienteFed.id eq null}" >
                        <t:graphicImage url="image/salva.png" border="0" title="Salva inserimento"/>
                        <f:param name="bean" value="beanClienteFed" />
                        <f:param name="idPadre" value="#{beanCliente.id}"/>                 
                    </h:commandLink>                
                </td>
                <td>
                    <h:commandLink dir="RTL" title="inserisce nuovo elemento" action="#{dettaglioClienteFed.inserisciDettaglio}" rendered="#{beanClienteFed.id ne null}" >
                        <t:graphicImage url="image/nuovo.png" border="0" title="Inserisci NUOVO"/>
                        <f:param name="bean" value="beanClienteFed" />
                    </h:commandLink>
                </td>
                <td>
            </tr>
        </table>
    </h:form> 

    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
                <h:messages style="color: red" showDetail="true" showSummary="false"/>
                <f:verbatim></td></table></f:verbatim>
            </h:form>     

    <jsp:include page="/piePagina.jsp"/>      
</f:view>
